/*
 * @Author: 
 * @Date: 2025-02-11 15:11:11
 * @LastEditor: zhuxiaoyi
 * @LastEditTime: 2025-02-11 15:11:23
 * @Description: 
 */
import { Provide, Inject } from '@midwayjs/core';
import { DPModelInfoService } from '../service/ModelInfo.service';
import { DPModelInfoCreateDto, DPModelInfoUpdateDto, DPModelInfoQueryDto, DPModelInfoDeleteDto } from '../dto/ModelInfo.dto';
import { Controller, Post, Put, Get, Del, Body, Query } from '@midwayjs/decorator';

@Provide()
@Controller('/model-info')
export class DPModelInfoController {

  @Inject()
  dpModelInfoService: DPModelInfoService;

  // 创建模型信息
  @Post('/create')
  async create(@Body() createDto: DPModelInfoCreateDto) {
    const result = await this.dpModelInfoService.createModelInfo(createDto);
    return result;
  }

  // 更新模型信息
  @Put('/update')
  async update(@Body() updateDto: DPModelInfoUpdateDto) {
    const result = await this.dpModelInfoService.updateModelInfo(updateDto);
    return result;
  }

  // 查询模型信息（分页）
  @Get('/query')
  async query(@Query() queryDto: DPModelInfoQueryDto) {
    const result = await this.dpModelInfoService.findModelInfo(queryDto);
    return result;
  }

  // 删除模型信息
  @Del('/delete')
  async delete(@Body() deleteDto: DPModelInfoDeleteDto) {
    const result = await this.dpModelInfoService.deleteModelInfo(deleteDto);
    return result;
  }
}
